package com.jacars.rabbitmq.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName RabbitMQAutoConfig
 * @Description TODO
 * @Author whf
 * @Date 2020/10/17 11:10
 * @Version 1.0
 */
@Configuration
public class RabbitMQAutoConfig {
    /**
     * 消息对象转换器，不使用java默认的序列化工具，改为jackson序列化工具
     * @return MessageConverter
     */
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }

}

